package cn.xiaohui;

public class Shopping {
     public static void main(String[] arge) {
    	 Prouduct p1=new Prouduct();
    	 Prouduct p2=new Prouduct();
    	 Prouduct p3=new Prouduct();
    	 Prouduct p4=new Prouduct();
    	 Prouduct p5=new Prouduct();
    	 p1.setProname("电视机");
    	 p2.setProname("洗衣机");
    	 p3.setProname("豆浆机");
    	 p4.setProname("空调机");
    	 p5.setProname("吹风机");
    	 Market m=new Market();
    	 m.setMarketName("家乐福");
    	 m.setProductArr(new Prouduct[] {p1,p2,p3,p4,p5});
    	 Person p =new Person();
    	 p.setName("小小");
    	 Prouduct result =p.shopping(m,"豆浆机");
    	 if(result !=null) {
    		 System.out.println(p.getName() +"在"+m.getMarketName()+"买到了"+result.getProName());
    	 }else {
    		 System.out.println(p.getName()+"白跑一趟，在"+m.getMarketName()+m.getMarketName()+"什么都没买到");
    	 }
     }
}
